namespace IQIGame.Onigao.Framework
{
    public interface IPOD
    {
        public void Clear();

        public void Serial(SOutputStream sout);

        public void UnSerial(SInputStream sin);

        public void UnSerial(byte[] bytes)
        {
            using SInputStream inputStream = new();
            inputStream.Init(bytes, 0, bytes.Length);
            UnSerial(inputStream);
        }

        public byte[] Serial(int capacity = 32)
        {
            using SOutputStream outputStream = new(capacity);
            Serial(outputStream);
            return outputStream.ToByteArray();
        }

    }
}
